package com.rpg.world;

import android.app.Activity;
import android.graphics.Canvas;
import android.graphics.Color;
import android.view.MotionEvent;
import android.view.View;

import com.rpg.Drawable_I;

public class Dungeon extends View implements Drawable_I, View.OnTouchListener {
	
//	private Activity activity;
	private Sprite myGuy;

	public Dungeon(Activity act, Sprite guy) {
		super(act);
//		activity = act;
		myGuy = guy;
		myGuy.setX(100);
		myGuy.setY(100);
		setOnTouchListener(this);
	}

	public void onDraw(Canvas canvas) {
		canvas.drawColor(Color.BLACK);
		myGuy.onDraw(canvas);
	}

	public boolean onTouch(View v, MotionEvent event) {
		moveGuy((int)event.getRawX(), (int)event.getRawY());
		return false;
	}
	
	private void moveGuy(int x, int y) {
		myGuy.setX(x);
		myGuy.setY(y);
		this.invalidate();
	}

}
